﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WJP.Configuration
{
    /// <summary>
    /// 客户端配置
    /// </summary>
    public class ClientConfigElement : ConfigurationElement
    {
        /// <summary>
        /// Host终结点
        /// </summary>
        [ConfigurationProperty("hostInfoEndpoint", IsRequired = true)]
        public string HostInfoEndpoint
        {
            get
            {
                return (string)this["hostInfoEndpoint"];
            }
            set
            {
                this["hostInfoEndpoint"] = (object)value;
            }
        }

        /// <summary>
        /// Host地址
        /// </summary>
        [ConfigurationProperty("hostInfoAddress", IsRequired = true)]
        public string HostInfoAddress
        {
            get
            {
                return (string)this["hostInfoAddress"];
            }
            set
            {
                this["hostInfoAddress"] = (object)value;
            }
        }

        /// <summary>
        /// 服务终结点
        /// </summary>
        [ConfigurationProperty("serviceEndpoint", IsRequired = true)]
        public string ServiceEndpoint
        {
            get
            {
                return (string)this["serviceEndpoint"];
            }
            set
            {
                this["serviceEndpoint"] = (object)value;
            }
        }

        /// <summary>
        /// 服务地址
        /// </summary>
        [ConfigurationProperty("serviceAddress", IsRequired = true)]
        public string ServiceAddress
        {
            get
            {
                return (string)this["serviceAddress"];
            }
            set
            {
                this["serviceAddress"] = (object)value;
            }
        }

        /// <summary>
        /// 主Host地址配置
        /// </summary>
        [ConfigurationProperty("hosts")]
        public AddressElementCollection HostCollection
        {
            get
            {
                return (AddressElementCollection)this["hosts"];
            }
        }
    }
}
